package com.demo2do.fms.scheduler.service.impl;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.fms.entity.business.Shipment;
import com.demo2do.fms.scheduler.dao.fms.FmsDao;
import com.demo2do.fms.scheduler.service.ShipmentReader;

/**
 *
 * @author Ark
 *
 */
@Service("shipmentReader")
public class ShipmentReaderImpl implements ShipmentReader {
    
    @Dao
    private FmsDao fmsDao;
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.scheduler.service.ShipmentReader#loadUnConfirmSection()
     */
    public Map<String, BigDecimal> loadUnConfirmSection() {
    	Date beginDate = DateUtils.addDays(new Date(), -1);
    	Map<String, BigDecimal> section = fmsDao.loadUnConfirmSection(beginDate);
    	return section;
    }

    /* (non-Javadoc)
     * @see com.demo2do.fms.scheduler.service.ShipmentReader#listUnElectronicConfirm(java.lang.Long, java.lang.Long)
     */
    public List<Shipment> listUnElectronicConfirm(Long startId, Long endId) {
        return fmsDao.listUnElectronicConfirm(startId, endId);
    }

}
